<?php
  
  class TugasAkhirMain{
    var $procDir='com/tugas_akhir/process/';
    var $procObj;
    //var $params=array();
    
    public function TugasAkhirMain($act,$params){
      $this->loadProcess('ProcessTugasAkhir.class.php');
      $this->procObj=new ProcessTugasAkhir();
      #print_r($this->params);exit;
      $this->params=$params;
      $this->addAction($act);
    }
    
    function loadProcess($processFile){
      if(file_exists($this->procDir.$processFile)){
         require($this->procDir.$processFile); 
      }else{
        print('Process File '.$this->procDir.$processFile.' Not Exist');
      }   
    }
    
    function addAction($act=""){
      switch($act){
        case "getStatusTugasAkhir":
           $this->procObj->getStatusTugasAkhir();
        break;
        case "getTopikTugasAkhir":
           $this->procObj->getTopikTugasAkhir();
        break;
        case "getDataComboTugasAkhir":
           $this->procObj->getDataComboTugasAkhir($this->params[0]);
        break;
        case "getDataTugasAkhirByMhsId":
           $this->procObj->getDataTugasAkhirByMhsId($this->params[0]);
        break;
        case "getDataTugasAkhirById":
           $this->procObj->getDataTugasAkhirById($this->params[0]);
        break;
        case "doAddTugasAkhir":
           $this->procObj->doAddTugasAkhir($this->params[0],$this->params[1],$this->params[2],$this->params[3],$this->params[4],$this->params[5]);
        break;
        case "doUpdateTugasAkhir":
           $this->procObj->doUpdateTugasAkhir($this->params[0],$this->params[1],$this->params[2],$this->params[3],$this->params[4],$this->params[5],$this->params[6]);
        break;
        default:
          die('Function '.$act.' Not Declare');
        break;
      }
    }
  }
?>
